<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>正则表达式中的原子表</title>
</head>
<body>
    <script>
        let tel = "2021-12/27";
        // 中间连接的符号可以是-，也可以是/
        let reg = /^\d{4}[-\/]\d{2}[-\/]\d{2}$/;
        console.log(reg.exec(tel));
    </script>
</body>
</html>